
from django.urls import path
from userweb import views
# =========== 导入drf Router =============
from rest_framework.routers import DefaultRouter


# 1. 实例化router对象
router = DefaultRouter()

# 2. 注册viewset
router.register('accounts', views.AccounViewSet, basename="accounts")
router.register('roles', views.RolesViewSet, basename='roles')
router.register('departments', views.DepartmentViewSet, basename='departments')
router.register('positions', views.PositionViewSet, basename='positions')

urlpatterns = [
    path('login/',views.LoginView.as_view()),
]

# 3. 累加urlpatterns中记录
urlpatterns += router.urls

